package com.jintian.hnsj_metting.api

import com.hjq.http.EasyHttp
import com.hjq.http.config.IRequestApi
import com.hjq.http.listener.HttpCallbackProxy
import com.jintian.hnsj_metting.BaseActivity
import com.jintian.hnsj_metting.api.bean.DeviceIssuePageVO
import com.jintian.hnsj_metting.util.DeviceInfo


class FaceApi {
    companion object {
        fun getFaceList(
            activity: BaseActivity,
            listener: HttpCallbackProxy<HttpData<List<DeviceIssuePageVO>>>
        ) {
            EasyHttp.get(activity)
                .api(FaceListApi())
                .request(listener)
        }

        fun faceBuildReport(
            activity: BaseActivity,
            ids: List<Long>,
            listener: HttpCallbackProxy<HttpData<Any>>
        ) {
            val api = FaceBuildReportApi().apply {
                issueIds = ids
            }
            EasyHttp.post(activity)
                .api(api)
                .request(listener)
        }
    }

    class FaceListApi : IRequestApi {

        override fun getApi(): String {
            return "device/hik/gate/query-issue/${DeviceInfo.getSN()}";
        }
    }

    class FaceBuildReportApi : IRequestApi {

        var issueIds: List<Long>? = null

        override fun getApi(): String {
            return "device/hik/gate/report-issue-completed";
        }
    }
}